Most video coding algorithms, including H.264\AVC video coding standard, use temporal redundancy of images in consequent frames to reduce size of coded bit-stream. In these algorithms, where the Reference frame is a previously coded frame and Target frame is a frame being currently coded, only the residual (i.e. difference) between reference and target frame is typically coded. Often, a video scene contains moving objects, and in order to minimize the residual between target and reference images, a motion estimation (ME) process may be used in order to find better match between target and reference images. This process is typically done at block granularity, yielding a motion vector (MV) per every block of the target image, which describes movement between the target and reference images. These motion-vectors are typically also coded into the bit-stream. Motion compensation (MC) may employ the above motion vectors to create an improved reference image, block by block, by taking parts from the original reference image (sometimes interpolating pixels, in case MVs are in sub-pixel resolution) and creating a motion compensated reference image, such that it will yield smaller residual when subtracting from target image.
Motion estimation algorithms often aim to find a MV that minimizes sum of absolute differences (SAD) or sum of square differences (SSD) between a target block and a reference block. Such algorithms are sensitive to global illumination changes, for example fade-in and fade-out video effects, change of lighting conditions, and/or the like. The H.264\AVC video coding standard offers a weighted prediction (WP) tool that enables the encoder to scale or offset the reference frame, in order to make it similar to the target frame, and by doing this reduce the residual. This process of WP is done by multiplying all of the reference image pixels value by a coefficient and adding an offset (an additive term). The process of weighted prediction coefficients estimation is, in essence, the process of estimating the weight and offset of the reference frame.